<template>
  <div>
    <tb-report :columns="columns" :apiUrl="apiUrl" :tableData="tableData" :getData="getData"></tb-report>
  </div>
</template>

<script>
import TbReport from "@/components/tb-report/index.vue";

export default {
  name: "App",
  components: { TbReport },
  data() {
    return {
      title: "首页",
      apiUrl: "/scm/api/v1/scmStandingBook/exportQueryByPage",
      columns: [
      {
          title: "序号",
          fixed: "left",
          type: "seq",
          width: 60,
          align: "center",
        },
        {
          title: "物资名称",
          align: "center",
          width: 100,
          field: "materialName",
          key: "materialName",
        },
        {
          title: "内贸合同号",
          field: "contractNo",
          width: 100,
          align: "center",
          key: "contractNo",
        },
        {
          title: "供应商名称",
          align: "center",
          width: 100,
          field: "supplier",
          key: "supplier",
        },
        {
          title: "项目名称",
          align: "center",
          width: 100,
          field: "programName",
          key: "programName",
        },
        {
          title: "采购公司",
          align: "center",
          width: 100,
          field: "purchaseCorp",
          key: "purchaseCorp",
        },
        {
          title: "项目采购经理",
          align: "center",
          width: 100,
          field: "purchaseManager",
          key: "purchaseManager",
        },
        {
          title: "采购业务员",
          align: "center",
          width: 100,
          field: "purchaser",
          key: "purchaser",
        },
        {
          title: "催交接单日期",
          field: "expediteAcceptDate",
          align: "center",
          width: 100,
          key: "expediteAcceptDate",
        },
        {
          title: "合同交货日期",
          field: "deliveryDate",
          align: "center",
          width: 100,
          key: "deliveryDate",
        },
        {
          title: "批次号",
          field: "batchNo",
          key: "batchNo",
          align: "center",
          width: 100,
          width: 200,
        },
        {
          title: "是否免检",
          field: "checkFlagStr",
          key: "checkFlagStr",
          align: "center",
          width: 100,
        },
        {
          title: "集港码头",
          align: "center",
          field: "wharfName",
          key: "wharfName",
          width: 100,
        },
        // {
        //   title: '上传资料审核',
        //   align: 'center',
        //   field: 'uploadDataReview',
        //   key: 'uploadDataReview',
        //   width: 100,
        // },
        {
          title: "预计交货日期",
          field: "planDeliveryDate",
          key: "planDeliveryDate",
          align: "center",
          width: 100,
        },

        {
          title: "要求包装完成日期",
          field: "packagingCompletionDate",
          key: "packagingCompletionDate",
          align: "center",
          width: 140,
        },
        {
          title: "实际集港日期",
          field: "actualPortGatherDate",
          key: "actualPortGatherDate",
          align: "center",
          width: 100,
        },
        // {
        //   title: '本周催交情况',
        //   align: 'center',
        //   field: 'situationweek',
        //   key: 'situationweek',
        //   width: 100,
        // },
        {
          title: "追溯号",
          field: "traceBackNo",
          key: "traceBackNo",
          width: 100,
          align: "center",
        },
        {
          title: "是否监造",
          field: "inspectFlagStr",
          key: "inspectFlagStr",
          width: 100,
          align: "center",
        },
        {
          title: "状态",
          field: "batchStatusStr",
          key: "batchStatusStr",
          width: 100,
          align: "center",
        },
        {
          title: "催交员",
          field: "expeditorName",
          key: "expeditorName",
          align: "center",
          width: 100,
        },
        {
          title: "监造经理",
          field: "inspectorManagerName",
          key: "inspectorManagerName",
          align: "center",
          width: 100,
        },
        {
          title: "项目客户",
          field: "programCustomer",
          key: "programCustomer",
          align: "center",
          width: 100,
        },
        {
          title: "项目编号",
          field: "programNumber",
          key: "programNumber",
          align: "center",
          width: 100,
        },
        {
          title: "申购单号",
          field: "applyBuyNo",
          key: "applyBuyNo",
          align: "center",
          width: 100,
        },
        {
          title: "商品名称",
          field: "goodsName",
          key: "goodsName",
          align: "center",
          width: 100,
        },
        {
          title: "型号",
          field: "goodsModel",
          key: "goodsModel",
          align: "center",
          width: 100,
        },
        {
          title: "规格",
          field: "goodsSpecification",
          key: "goodsSpecification",
          align: "center",
          width: 100,
        },
        {
          title: "品牌",
          field: "goodsBrand",
          key: "goodsBrand",
          align: "center",
          width: 100,
        },
        {
          title: "用途",
          field: "purpose",
          key: "purpose",
          align: "center",
          width: 100,
        },
        {
          title: "设备位号",
          field: "equipmentItemNo",
          key: "equipmentItemNo",
          align: "center",
          width: 100,
        },
        {
          title: "子项号/成本中心代码",
          field: "childItemNo",
          key: "childItemNo",
          align: "center",
          width: 100,
        },
        {
          title: "申购人",
          field: "applyBuyPerson",
          key: "applyBuyPerson",
          align: "center",
          width: 100,
        },
        {
          title: "数量",
          field: "expediteQuantity",
          key: "expediteQuantity",
          align: "center",
          width: 100,
        },
        {
          title: "成交单位",
          field: "tradeUnitLabel",
          key: "tradeUnitLabel",
          align: "center",
          width: 100,
        },
        {
          title: "需求接单日期",
          field: "demandAcceptDate",
          key: "demandAcceptDate",
          align: "center",
          width: 100,
        },
        {
          title: "项目要求集港日期",
          field: "requirePortGatherDate",
          key: "requirePortGatherDate",
          align: "center",
          width: 180,
        },

        {
          title: "项目要求现场到货日期",
          align: "center",
          field: "requirePortArriveDate",
          key: "requirePortArriveDate",
          width: 180,
        },
        {
          title: "技术条件确认完成日期",
          field: "technicalConfirmDate",
          key: "technicalConfirmDate",
          align: "center",
          width: 180,
        },
        {
          title: "货期/制造周期/施工周期（天）",
          field: "deliveryCycle",
          key: "deliveryCycle",
          align: "center",
          width: 220,
        },

        {
          title: "合同签订日期",
          field: "signedDate",
          key: "signedDate",
          align: "center",
          width: 180,
        },
        {
          title: "付款条件",
          field: "paymentCondition",
          key: "paymentCondition",
          align: "center",
          width: 100,
        },

        {
          title: "最新合同金额（元）",
          field: "latestContractAmount",
          key: "latestContractAmount",
          align: "center",
          width: 140,
        },
        {
          title: "供应商联系人",
          field: "supplierContactName",
          key: "supplierContactName",
          align: "center",
          width: 180,
        },
        {
          title: "供应商联系方式",
          field: "supplierContactMobile",
          key: "supplierContactMobile",
          align: "center",
          width: 180,
        },
        {
          title: "合同逾期天数",
          field: "contractOverdueDays",
          key: "contractOverdueDays",
          align: "center",
          width: 180,
        },
        {
          title: "配载船次",
          field: "loadVesselNumber",
          key: "loadVesselNumber",
          align: "center",
          width: 100,
        },
        {
          title: "靠泊时间",
          field: "berthingTime",
          key: "berthingTime",
          align: "center",
          width: 120,
        },
        {
          title: "离港时间",
          field: "departureTime",
          key: "departureTime",
          align: "center",
          width: 120,
        },
        {
          title: "备注",
          field: "demandRemark",
          key: "demandRemark",
          align: "center",
          width: 100,
        },
      ],
      tableData:[],
    };
  },
  methods:{
    getData(data){
           if (this.tableData.length == 0) {
            this.tableData = data;
           } else {
            this.tableData = [...this.tableData, ...data];
          }
    }
  }
};
</script>

<style>
</style>
